package com.service.impl;

import java.sql.SQLException;
import java.util.List;

import com.dao.StudentDao;
import com.dao.impl.StudentDaoImpl;
import com.entity.Group;
import com.entity.Student;
import com.service.StudentService;

public class StudentServiceImpl implements StudentService {
	
	private StudentDao studentDao = new StudentDaoImpl();

	@Override
	public Integer save(Student t) throws SQLException {
		return studentDao.insert(t);
	}

	@Override
	public Integer update(Student t) throws SQLException {
		return studentDao.update(t);
	}

	@Override
	public Integer remove(Integer id) throws SQLException {
		return studentDao.delete(id);
	}

	@Override
	public Student getById(Integer id) throws SQLException {
		return studentDao.selectById(id);
	}

	@Override
	public List<Student> getAll() throws SQLException {
		return studentDao.selectAll();
	}

	@Override
	public List<Student> orderByAge() throws SQLException {
		return studentDao.orderByAge();
	}

	
	@Override
	public List<Student> orderByName() throws SQLException {
		return studentDao.orderByName();
	}

	
	@Override
	public List<Group> groupByMajor() throws SQLException {
		return studentDao.groupByMajor();
	}

	@Override
	public List<Group> groupByAge() throws SQLException {
		return studentDao.groupByAge();
	}
	
	
	

	

	

	
	
	
	
	

}
